package tech.aistar.day04;

import tech.aistar.util.DateUtil;

import java.util.Date;

/**
 * 本类用来演示: 客户测试类
 *
 * @author: success
 * @date: 2022/7/21 9:45 上午
 */
public class CustomerTest {
    public static void main(String[] args) {
        //1. 创建客户对象
        //Customer c = new Customer();
        //
        //c.setName("王宝强");
        //
        //System.out.println(c.getName());
        // c.setCustomerId(1);
        // System.out.println(c.getCustomerId());

        //创建对象的同时进行赋值操作,机会只有1次
        Customer c1 = new Customer(1,"admin");
        Customer c2 = new Customer(1,"admin");
        System.out.println(c1 == c2);//false

        //Customer类属于Object类的子类,子类可以访问父类中所有的非私有的成员
        //equals方法底层也是比较==

        //==  1. 基本类型比较数值   2. 对象类型比较地址.
        System.out.println(c1.equals(c2));//false

        Customer c3 = new Customer(3,"王宝强","110", DateUtil.createDate(2022,6,1));
        Customer c4 = new Customer(3,"王宝强",null,null);

        System.out.println(c3.getName());

        System.out.println(c3);
    }
}
